package com.example.Laboratory.Service.Impl;


import com.example.Laboratory.Entity.Achievements_software;
import com.example.Laboratory.Mapper.Achievements_softwareMapper;
import com.example.Laboratory.Service.Achievements_softwareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Achievements_softwareServiceImpl implements Achievements_softwareService {

    @Autowired
    Achievements_softwareMapper achievements_softwareMapper;

    //增加科研成果-软件著作权信息
    @Override
    public String addAchievements_software(Achievements_software s) {
        if (achievements_softwareMapper.addAchievements_software(s) == 1) {
            return "添加成功";
        } else {
            return "添加失败";
        }
    }

    //根据id删除信息
    @Override
    public String deleteAchievements_software(int achievements_software_id) {
        if (achievements_softwareMapper.deleteAchievements_software(achievements_software_id) == 1) {
            return "删除成功";
        } else {
            return "删除失败";
        }
    }

    //查找全表信息
    @Override
    public List<Achievements_software> researchAchievements_software() {
        return achievements_softwareMapper.researchAchievements_software();
    }

    //修改信息
    @Override
    public String reviseAchievements_software(Achievements_software s) {
        if (achievements_softwareMapper.reviseAchievements_software(s) == 1) {
            return "修改成功";
        } else {
            return "修改失败";
        }
    }
}
